//
//  KYPrizeDrawCellView.m
//  KYPrizeDrawDemo
//
//  Created by 罗新 on 2017/10/30.
//  Copyright © 2017年 KuaiYan  Co.,LTD. All rights reserved.
//

#import "KYPrizeDrawCellView.h"
#import "KYCheckInPrizeModel.h"
#import "UIImageView+KYWebCache.h"
@interface KYPrizeDrawCellView()
@property (nonatomic, weak) UIImageView *imgeView;
@property (nonatomic, weak) UILabel *label;
@end
@implementation KYPrizeDrawCellView
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self initSubview];
    }
    return self;
}
- (void)initSubview{
    UIImageView *imgV = [[UIImageView alloc] init];
    imgV.contentMode = UIViewContentModeScaleAspectFit;
    [self addSubview:imgV];
    imgV.image = [UIImage ky_imageNamed:@"checkIn_thanks.png"];
    self.imgeView = imgV;
    
    UILabel *label = [[UILabel alloc] init];
    label.textAlignment = NSTextAlignmentCenter;
    label.font = [UIFont systemFontOfSize:12];
    label.textColor = [UIColor grayColor];
    label.text = @"谢谢惠顾";
    [self addSubview:label];
    self.label = label;
    self.layer.borderColor = [UIColor colorWithRGBHex:0xf7ce69].CGColor;
    self.layer.cornerRadius = 5;
    self.layer.borderWidth = 0.0;
    self.backgroundColor = [UIColor colorWithRGBHex:0xf7f7f7];
};

- (void)layoutSubviews{
    [super layoutSubviews];
    self.imgeView.frame = CGRectMake(15, 10, 50, 50);
    self.label.frame = CGRectMake(0, 55, 80, 20);
}
- (void)refreshDataWithModel:(KYCheckInPrizeModel *)model{
    [self.imgeView KYSD_setImageWithURL:[NSURL URLWithString:model.tubiaoImg] completed:nil];
    self.label.text = model.tubiaoTitle;
}

@end
